500 PRINT"[147] [146]" 501 PRINT" [146]" 502 FORPA=1TO800:NEXT 505 FORT=1TO14 510 PRINT"[145]";TAB(T);"[157] ADDING[146]":FORPA=1TO50:NEXTPA: NEXT 511 FORPA=1TO1000:NEXTPA 515 PRINT" [146]" 520 PRINT" [146]" 525 FORT=1TO15 530 PRINT"[145]";TAB(T);"[157] AND[146]":FORPA=1TO50:NEXTPA:NEXT 540 FORPA=1TO1000:NEXTPA 550 PRINT" [146]" 560 PRINT" [146]" 570 FORT=1TO12 580 PRINT"[145]";TAB(T);"[157] SUBTRACTING[146]":FORPA=1TO50:NEXTPA:NEXT 590 FORPA=1TO1000:NEXT 600 PRINT" [146]" 610 PRINT" [146]" 620 FORT=1TO10 630 PRINT"[145]";TAB(T);"[157] SIGNED NUMBERS[146]":FORPA=1TO50:NEXTPA:NEXT 635 PRINT" [146]" 640 FORPA=1TO6000:NEXT 700 REM 710 REM ** ADDING AND SUBTRACTING SIGNED NUMBERS ** 720 REM 730 REM BY: MICHAEL SAMORODNY! 735 REM 740 REM COPYRIGHT MAY 1980 750 REM 1000 PRINT"[147]HELLO, MY NAME IS PET[146]. TYPE IN" 1005 PRINT"YOUR NAME AND PRESS RETURN[146]" 1010 INPUT"";NAME$ 1020 PRINT"[147]HELLO, ";NA$;"!":PRINT"LET'S LEARN ABOUT ADDING AND" 1030 PRINT"SUBTRACTING SIGNED NUMBERS!" 1040 FORPA=1TO6000:NEXT 1050 PRINT"[147]THE FIRST THING YOU MUST LEARN IS WHAT":PRINT"TO DO "; 1060 PRINT"WITH ALL THOSE MESSY[146] SIGNS." 1070 FORPA=1TO6000:NEXT 1080 PRINT"[147]LET'S LOOK AT THE FOLLOWING EXAMPLE:" 1090 PRINT"4-+2+-21++36--10":FORPA=1TO5500:NEXT 1100 PRINT"BRACKETS MAKE IT CLEARER,":FORPA=1TO2000:NEXT 1110 PRINT"4-(+2)+(-21)+(+36)-(-10)":FORPA=1TO5000:NEXT 1120 PRINT"BUT THE NUMBER OF SIGNS STILL MAKE IT":PRINT"CONFUSING." 1130 FORPA=1TO5000:NEXT 1140 PRINT"[147]NOW LET'S LOOK AT SOME RULES FOR":PRINT"SIMPLIFYING SIGNS." 1150 FORPA=1TO4000:NEXT:GOSUB5000 1160 PRINT"[147]HERE IS A SHORT QUIZ TO SEE IF YOU" 1170 PRINT"UNDERSTAND HOW TO SIMPLIFY SIGNS":PRINT 1180 PRINTNA$;".":FORPA=1TO4500:NEXT 1190 PRINT"[147]SIMPLIFY THE SIGNS IN THIS QUESTION:" 1200 PRINT"-32--4+-10-+71++3":FORPA=1TO2500:NEXT 1210 PRINT"JUST TYPE IN THE SIMPLIFIED VERSION OF" 1220 PRINT"THE ABOVE AND CHECK YOUR ANSWER 1225 [153][163]14);"TAB(TAB(TAB(TAB(TAB(" 1230 [153]"CAREFULLY BEFORE HITTING RETURNWAIT." 1240 [153]"TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(" 1245 [153]"USE THE INSTWAIT KEY AT THE UPPER RIGHT OF" 1246 [153]" DEL WAIT" 1247 [153]"THE KEYBOARD TO ERASE MISTAKES." 1250 [133] A1$ 1260 [139]A1$[178]"-32+4-10-71+3"[167] [153]"CORRECT ";NA$;"!WAIT":[137]1275 1270 [141]6000 1275 [129]PA[178]1[164]2000:[130] 1280 [153]"LOADHERE IS A SECOND QUESTION FOR YOU TO" 1290 [153]"SIMPLIFY. JUST DO THE SAME AS FOR THE ":[153]"LAST ONE." 1300 [153]" +6--47++1.6-+487+-1" 1310 [133]A2$ 1320 [139]A2$[178]"6+47+1.6-487-1"[167][153]"VERY GOOD, ";NA$;"!!WAIT":[137]1340 1330 [141]6000 1340 [129]PA[178]1[164]2500:[130] 1350 [153]"LOADYOU SEEM TO UNDERSTAND SIMPLIFICATION " 1360 [153]"FAIRLY WELL, ";NA$;"." 1370 [153]"LET'S MOVE ON TO LEARNING SOME RULES" 1380 [153]"FOR ADDING AND SUBTRACTING THESE SIGNED":[153]"NUMBERS." 1390 [129]PA[178]1[164]7000:[130]PA:[141]7000 1400 [153]"LOADALL RIGHT, ";NA$;"," 1410 [153]"LET'S MOVE ON TO A SORT OF TEST TO SEE" 1420 [153]"HOW YOU ARE PROGRESSING!" 1430 [129] PA[178]1[164]4500:[130] 1440 [153]"LOAD EXAMINATION WAIT" 1450 [153]"HOW MANY QUESTIONS WOULD YOU LIKE?" 1460 [153]"TYPE IN THE NUMBER AND PRESS RETURNWAIT." 1470 [133]Z 1471 [139]Z[178]0[167][153]"SORRY, YOU HAVE TO DO AT LEAST ONE!":[137]1450 1474 [129]QU[178]1[164]Z 1475 [153]"" 1477 [129]Y[178]1[164]21 1480 [153]" ":[130] 1500 [153]"QUESTION ";QU;":" 1510 Q(1)[178][181]([187](1)[172]10[170]1) 1520 Q(2)[178][181]([187](1)[172]50[170]1) 1530 Q(3)[178][181]([187](1)[172]100[170]1) 1540 Q(4)[178][181]([187](1)[172]25[170]1) 1550 Q(5)[178][181]([187](1)[172]75[170]1) 1560 [129]G[178]1[164]5 1570 X[178][181]([187](1)[172]2[170]1) 1575 [139]X[178]1[167]Q(G)[178]Q(G)[172][171]1 1580 [130] G 1585 [153]"";Q(1);"+";Q(2);"-";Q(3);"+";Q(4);"-";Q(5) 1586 [153]"DO YOU WANT TO SEE ANY OF THE RULES":[153]"AGAIN?" 1587 [153]"(Y OR N)" 1588 [161] M$:[139] M$[178]""[167] 1588 1589 [139] M$[178]"Y" [167] [141] 9000:[141]9500:[137]1585 1590 [139]M$[179][177]"N"[167]1588 1599 [153]"TYPE IN YOUR ANSWER HERE AND PRESS":[153]"RETURNWAIT":[133]ANS 1600 V[178]Q(1)[170]Q(2)[171]Q(3)[170]Q(4)[171]Q(5) 1610 [139] ANS[178]V [167][141]8000 1620 [139]ANS[179][177]V[167] [141] 8500 1630 [130]QU 1640 [153]"LOADWELL THAT'S THE END OF THE QUIZ,":[153]NA$;"." 1650 [153]"YOUR SCORE IS ";SC;"(null)";Z 1655 U[178][181](SC[173]Z[172]100[170].5) 1660 [153]"THAT MAKES AN AVERAGE OF";U;"CMD%WAIT":[129]PA[178]1[164]7000:[130]PA 1670 [139] U[177][178]75[167][141]6600 1680 [139]U[177][178]60 [167] [141] 6700 1685 [139]U[177][178]50[175]U[179]60[167][141]6800 1690 [153]"LOADI AM TERRIBLY SORRY, ";NA$;"WAIT," 1700 [153]"BUT YOU HAVE FAILED THIS COURSE." 1710 [153]"I THINK YOU SHOULD SEE YOUR MATH TEACHER" 1720 [153]"FOR FURTHER INSTRUCTION BEFORE" 1730 [153]"REATTEMPTING THIS COURSE." 1735 [153]"THANK YOU FOR YOUR PATIENCE!" 1740 [137]6630 4999 [128] 5000 [153]"LOAD"; 5010 STS$[178]"***************************************" 5020 [153]STS$ 5030 [129] S[178]1[164]22 5040 [153]"*";[166]37);"*":[130] S 5050 [153]STS$ 5060 [153]""; 5070 [153]" HOW TO SIMPLIFY SIGNSWAIT" 5080 [153]"1. IF THERE ARE TWO '+' SIGNS IN A" 5090 [153]" ROW, REPLACE THEM BY A SINGLE '+'":[153]" SIGN." 5100 [153]" 2. IF THERE ARE TWO '-' SIGNS IN A" 5200 [153]" ROW, REPLACE THEM BY A SINGLE '+'":[153]" SIGN." 5300 [153]" 3. IF THERE IS A '+' SIGN FOLLOWED" 5400 [153]" BY A '-' SIGN, REPLACE THEM BY A" 5500 [153]" SINGLE '-' SIGN. 5510 PRINT" 4. OMIT A LEADING POSITIVE SIGN" 5520 PRINT" EG. +2-3 BECOMES 2-3. 5600 [153]" PRESS THE SPACE BARWAIT TO CONTINUE." 5700 [146]59410,4,4:[142] 6000 [153]"SORRY, ";NA$;" THAT'S WRONG.":[129]PA[178]1[164]2500:[130] 6005 W[178]W[170]1:[139]W[178]2[167][141]6500 6010 [153]"WOULD YOU LIKE TO LOOK AT THE RULES 6020 PRINT"AGAIN (Y OR N)" 6021 GETY1$:IFY1$=""THEN6021 6030 IF Y1$="Y"THEN GOSUB5000:GOTO6040 6035 IFY1$<>"N"THEN6021 6040 RETURN 6500 PRINT"[147]YOU HAVE ANSWERED BOTH QUESTIONS":PRINT"INCORRECTLY ";NA$ 6510 PRINT"PERHAPS YOU SHOULD GET SOME ADVICE FROM" 6520 PRINT"YOUR TEACHER BEFORE RETURNING TO THIS":PRINT"PROGRAM.":END 6600 PRINT"[147]CONGRATULATIONS, ";NA$;"!!![146]" 6610 PRINT"YOU PASSED THIS COURSE WITH HONOURS!" 6620 PRINT"YOU HAVE GRADUATED FROM THE P E T[146] SCHOOL":PRINT"OF ARITHMETIC!" 6630 PRINT" T H E E N D[146]" 6640 END 6700 PRINT"[147]CONGRATULATIONS, ";NA$;"!" 6710 PRINT"YOU HAVE PASSED THIS LESSON WITH" 6720 PRINT"FLYING COLOURS[146]!!" 6730 PRINT"BRAG TO YOUR TEACHER ABOUT YOUR GREAT" 6740 PRINT"ACCOMPLISHMENT!" 6750 GOTO6630 6800 PRINT"[147]YOU DID FAIRLY WELL, ";NA$;"," 6810 PRINT"BUT PERHAPS YOU COULD STILL USE A ":PRINT"LITTLE HELP." 6820 PRINT"HAVE YOUR TEACHER EVALUATE YOUR PROGRESS" 6830 PRINT"AND IF NECESSARY COME SEE ME AGAIN FOR" 6840 PRINT"ANOTHER LESSON." 6850 GOTO 6630 7000 PRINT"[147]"; 7020 PRINTSTS$ 7030 FOR S=1TO22 7040 PRINT"*";SPC(37);"*":NEXT S 7050 PRINTSTS$ 7060 PRINT""; 7070 PRINT" RULES FOR ADDING AND SUBTRACTING[146]" 7080 PRINT"1. SIMPLIFY ALL[146] SIGNS." 7090 PRINT"2. ADD OR SUBTRACT FROM LEFT":PRINT"TO RIGHT." 7100 PRINT"3. IF THE SIGNS OF THE NUMBERS ARE" 7110 PRINT"THE SAME, WRITE DOWN THEIR SIGN ":PRINT"AND ADD THEM UP." 7120 PRINT"4. IF THE SIGNS ARE DIFFERENT," 7130 PRINT"IGNORE THEM, PUT DOWN THE SIGN " 7140 PRINT"OF THE LARGER ONE AND SUBTRACT":PRINT"THE NUMBERS." 7145 PRINT"5. OMIT A LEADING '+' SIGN." 7150 PRINT"PRESS THE SPACE BAR[146] TO CONTINUE." 7160 WAIT59410,4,4:RETURN 8000 PRINT"" 8010 H$(1)="CORRECT!":H$(2)="EXCELLENT!!":H$(3)="VERY GOOD!":H$(4)="RIGHT ON!!" 8015 P=INT(RND(1)*4+1) 8020 FORB=1TO20 8030 PRINTH$(P):FORPA=1TO20:NEXTPA 8040 PRINT"[145]";H$(P);"[145]":NEXTB 8050 SC=SC+1 8060 RETURN 8500 PRINT"SORRY, ";NA$;", THAT'S WRONG." 8510 FORPA=1TO1000:NEXT 8520 PRINT"THE CORRECT ANSWER WAS ";V 8530 FORPA=1TO3000:NEXT 8540 RETURN 9000 PRINT"[147]WHICH SET OF RULES DO YOU WANT TO SEE?" 9010 PRINT"1. SIMPLIFYING SIGNS" 9020 PRINT"2. ADD AND SUB RULES" 9030 PRINT"JUST TYPE THE NUMBER OF THE SET OF RULES" 9040 PRINT"YOU WANT." 9050 GET I:IF I=1THEN GOSUB5000:RETURN 9060 IFI=2THEN GOSUB 7000:RETURN 9070 IFI<>1ORI<>2THEN9050 9500 PRINT"[147] EXAMINATION [146]" 9510 PRINT"" 9520 FORY=1TO21 9530 PRINT" ":NEXT 9540 PRINT"QUESTION ";QU;":" 9550 RETURN